package com.hong.course.client;

import com.hong.course.entity.Course;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;
/**
 * 描述：课程列表Feign客户端
 *  1. 通过@FeignClient注解指定服务名来绑定服务
 *  2. 通过@FeignClient的fallback属性指定服务降级处理类
 */
@Primary
@FeignClient(value = "course-list", fallback = CourseListclientHystrix.class)
public interface CourseListClient {
    @GetMapping("/courses")
    List<Course> courseList();
}
